package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YxxSanitationMapper;
import com.ruoyi.system.domain.YxxSanitation;
import com.ruoyi.system.service.IYxxSanitationService;

/**
 * 卫生检查记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-10
 */
@Service
public class YxxSanitationServiceImpl implements IYxxSanitationService 
{
    @Autowired
    private YxxSanitationMapper yxxSanitationMapper;

    /**
     * 查询卫生检查记录
     * 
     * @param recordId 卫生检查记录主键
     * @return 卫生检查记录
     */
    @Override
    public YxxSanitation selectYxxSanitationByRecordId(Long recordId)
    {
        return yxxSanitationMapper.selectYxxSanitationByRecordId(recordId);
    }

    /**
     * 查询卫生检查记录列表
     * 
     * @param yxxSanitation 卫生检查记录
     * @return 卫生检查记录
     */
    @Override
    public List<YxxSanitation> selectYxxSanitationList(YxxSanitation yxxSanitation)
    {
        return yxxSanitationMapper.selectYxxSanitationList(yxxSanitation);
    }

    /**
     * 新增卫生检查记录
     * 
     * @param yxxSanitation 卫生检查记录
     * @return 结果
     */
    @Override
    public int insertYxxSanitation(YxxSanitation yxxSanitation)
    {
        yxxSanitation.setCreateTime(DateUtils.getNowDate());
        return yxxSanitationMapper.insertYxxSanitation(yxxSanitation);
    }

    /**
     * 修改卫生检查记录
     * 
     * @param yxxSanitation 卫生检查记录
     * @return 结果
     */
    @Override
    public int updateYxxSanitation(YxxSanitation yxxSanitation)
    {
        yxxSanitation.setUpdateTime(DateUtils.getNowDate());
        return yxxSanitationMapper.updateYxxSanitation(yxxSanitation);
    }

    /**
     * 批量删除卫生检查记录
     * 
     * @param recordIds 需要删除的卫生检查记录主键
     * @return 结果
     */
    @Override
    public int deleteYxxSanitationByRecordIds(Long[] recordIds)
    {
        return yxxSanitationMapper.deleteYxxSanitationByRecordIds(recordIds);
    }

    /**
     * 删除卫生检查记录信息
     * 
     * @param recordId 卫生检查记录主键
     * @return 结果
     */
    @Override
    public int deleteYxxSanitationByRecordId(Long recordId)
    {
        return yxxSanitationMapper.deleteYxxSanitationByRecordId(recordId);
    }
}
